/**
 * @author wtcode
 * @date 2021/3/15 - 9:51
 */
public class Offer58 {

    public String reverseWords(String s) {
        StringBuilder sb = new StringBuilder();
        String[] split = s.split(" ");
        for (int i = split.length-1 ; i >= 0;i--){
            if(i==0){
                sb.append(split[i]);
            } else {
                sb.append(split[i]);
                sb.append(" ");
            }
        }
        return sb.toString();
    }
}
